﻿// Copyright (c) Inossem. All rights reserved.
// Licensed under the LGPL-3.0 license. See LICENSE file in the project root for full license information.
using DWF.Studio.RemoteCtrls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DWF.Studio.Host.RemoteHandler
{
    /// <summary>
    /// 活动通知处理类，此类为跨应用程序域事件的封送类
    /// </summary>
    public class ActivityNoticeHandler : MarshalByRefProxyBase
    {
        private Action<string, string> _action = null;

        /// <summary>
        /// 设置事件响应aciton
        /// </summary>
        /// <param name="action"></param>
        public void SetAction(Action<string, string> action)
        {
            _action = action;
        }

        /// <summary>
        /// 通知
        /// </summary>
        /// <param name="msg"></param>
        public void Action(string msg, string data)
        {
            if (_action != null)
            {
                _action(msg, data);
            }
        }
    }
}
